package com.example.bidc_work_state;

import android.os.Bundle;
import android.app.Activity;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.view.Menu;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;


@SuppressWarnings("deprecation")
public class MainViewActivity extends TabActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main_view);
		
		Resources res = getResources();
		TabHost tabhost = getTabHost();
		TabHost.TabSpec spec;
		Intent intent;		
		
		intent = new Intent().setClass(this, DelayedTaskActivity.class);
		spec = tabhost.newTabSpec("delayed tk").setIndicator("Delayed Task",res.getDrawable(R.drawable.ic_tab_delay_task)).setContent(intent);
		tabhost.addTab(spec);
		
		// Create an Intent to launch an Activity for the tab (to be reused)
		intent = new Intent().setClass(this, CurrentTaskActivity.class);
		
		//Initiate a TabSpec for each tab and add it to the TabHost
		spec = tabhost.newTabSpec("cur_tk").setIndicator("Current Task",res.getDrawable(R.drawable.ic_tab_curr_task)).setContent(intent);
		tabhost.addTab(spec);
		
		
		intent = new Intent().setClass(this, NextTaskActivity.class);
		spec = tabhost.newTabSpec("next tk").setIndicator("Next Task",res.getDrawable(R.drawable.ic_tab_next_task)).setContent(intent);
		tabhost.addTab(spec);
		
		tabhost.setCurrentTab(1);				

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main_view, menu);
		return true;
	}

}
